<template>
  <div class="container">
    <van-nav-bar>
      <template #left>
        <img class="logo" src="@/assets/images/logo.png" alt="" />
      </template>
      <template #right>
        <van-icon name="search" size="30" />
      </template>
    </van-nav-bar>
    <div class="swipe" @click="previewImg">
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item>
          <img src="@/assets/images/banner1.jpg" alt="" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/images/banner2.jpg" alt="" />
        </van-swipe-item>
        <van-swipe-item>
          <img src="@/assets/images/banner3.png" alt="" class="img3"/>
        </van-swipe-item>
      </van-swipe>
    </div>
    <div class="course">
      <div class="box">
        <img src="@/assets/images/jiuyeke.png" alt="" />
        <span>就业课</span>
      </div>
      <div class="box">
        <img src="@/assets/images/tishengke.png" alt="" />
        <span>提升课</span>
      </div>
      <div class="box">
        <img src="@/assets/images/mainfeike.png" alt="" />
        <span>免费课</span>
      </div>
      <div class="box">
        <img src="@/assets/images/courseType.png" alt="" />
        <span>课程分类</span>
      </div>
      <!-- 文字较短时，通过设置 scrollable 属性开启滚动播放 -->
    </div>
    <!-- 文字较短时，通过设置 scrollable 属性开启滚动播放 -->
    <van-notice-bar
      scrollable
      mode="closeable"
      text="前端与移动开发就业班【全面更新】!等待您的到来哦！。"
    />
    <div class="jykContext">
      <van-nav-bar>
        <template #left>
          <van-icon name="location-o" size="18" color="#000" />
          <span>就业课</span>
        </template>
        <template #right>
          <span>更多</span>
          <van-icon name="arrow" size="18" color="#000" />
        </template>
      </van-nav-bar>
      <div class="jyk">
        <img src="@/assets/images/data.png" alt="" />
        <img src="@/assets/images/fe-list.png" alt="" />
        <img src="@/assets/images/java.png" alt="" />
        <img src="@/assets/images/js.jpg" alt="" />
        <img src="@/assets/images/python.png" alt="" />
        <img src="@/assets/images/ui.png" alt="" />
      </div>
    </div>
    <div class="tagBar">
      <van-tabs v-model="active">
        <van-tab title="精品">
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-3.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-1.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-3.jpg"
            origin-price="129.00"
          />
        </van-tab>
        <van-tab title="爆品">
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-1.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-1.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-1.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-1.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-2.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/apple-3.jpg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
        </van-tab>
        <van-tab title="优惠">
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
          <van-card
            tag="标签"
            price="99.00"
            desc="描述信息"
            title="商品标题"
            thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
            origin-price="129.00"
          />
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script>
import { ImagePreview } from 'vant'
export default {
  name: 'home-index',
  components: {
    [ImagePreview.Component.name]: ImagePreview.Component
  },
  data () {
    return {
      active: 0
    }
  },
  methods: {
    previewImg () {
      ImagePreview([
        'https://img01.yzcdn.cn/vant/apple-1.jpg',
        'https://img01.yzcdn.cn/vant/apple-2.jpg',
        'https://img01.yzcdn.cn/vant/apple-3.jpg'
      ])
    }
  }
}
</script>

<style scoped lang="less">
.container {
  padding-bottom: 60px;
  background-color: rgb(245, 245, 245);
  .course {
    display: flex;
    justify-content: space-evenly;
    background-color: #fff;
    .box {
      display: flex;
      flex-flow: column;
      align-items: center;
      span {
        margin-top: 5px;
        font-size: 14px;
      }
    }
    img {
      width: 40px;
    }
  }
  .jykContext {
    margin-top: 10px;

    .jyk {
      padding-bottom: 10px;
      display: flex;
      justify-content: space-around;
      flex-wrap: wrap;
      width: 100%;
      background-color: #fff;
      img {
        margin-left: 25px;
        margin-top: 10px;
        border-radius: 50%;
        width: 70px;
        height: 70px;
      }
    }
  }
  .tagBar {
    margin-top: 10px;
    width: 100%;
  }
}
.logo {
  width: 120px;
}
.swipe {
  img {
    width: 375px;
  }
  .img3{
    height: 150px;
  }
}
.van-hairline--bottom:after {
  border-bottom-width: 0;
}
</style>
